<?php
$playlists = mcz_Playlist::findAllFromUserLogin($_SESSION['obj']->login);
?>
<p class="action">
	<?php echo(htmlspecialchars(T('Selection: ')));?>
	<input type="hidden" name="t" value="<?php echo(uniqid());?>"/>
	<label for="streamAction"><?php echo(htmlspecialchars(T('copy')));?></label>&nbsp;<input type="radio" id="streamAction" name="listaction" value="copy"/>
	<label for="streamAction"><?php echo(htmlspecialchars(T('stream')));?></label>&nbsp;<input type="radio" checked="checked" id="streamAction" name="listaction" value="stream"/>
	<label for="playlistAction"><?php echo(htmlspecialchars(T('add to playlist')));?></label>&nbsp;<input type="radio" id="playlistAction" name="listaction" value="playlist"/>
	<?php if(!empty($playlists)){?>
	<select name="existingPlaylist">
		<?php foreach($playlists as $playlist){ ?>
		<option value="<?php echo($playlist->id);?>"><?php echo(htmlspecialchars($playlist->title));?></option>
		<?php } ?>
	</select>
	<?php }?>
	<label for="newPlaylistName"><?php echo(htmlspecialchars(T('new one:')));?></label>&nbsp;<input type="text" name="newPlaylistName" id="newPlaylistName"/>
	<input type="submit" value="ok"/>
</p>
<ul>
<?php
$i = 0;
foreach($tunes as $tune){ ?>
	<li <?php echo($i%2 ? '' : ' class="even"');?>>
		<input type="checkbox" name="items[]" checked="checked" value="<?php echo($tune->id);?>"/>
		<?php
		echo('<a title="' . htmlspecialchars(T('artist page')) . '" href="' . mczURL('artist/show/' . urlencode($tune->artist)) . '">' . htmlspecialchars($tune->artist) . '</a>');?> - <strong>
		<?php
		if($_SESSION['obj']->can('download'))
		{
			echo('<a href="' . mczURL('tune/download/') . base64_encode(mcz_Crypt::crypt($_SESSION['obj']->login . '::::' . $tune->id)) . '" title="' . htmlspecialchars(T('download')) . '">' . htmlspecialchars($tune->title) . '</a></strong>');
		}
		else
		{
			echo(htmlspecialchars($tune->title) . '</strong>');
		}
		if($tune->album != '')
		{
			echo(' - <a title="' . htmlspecialchars(T('album page')) . '" href="' . mczURL('album/show/' . urlencode($tune->album)) . '"><em>[ '
			. htmlspecialchars($tune->album) . ' ]</em></a>');
		}
		/*
		if($tune->comment != '' and substr($tune->comment, 0, 3) != '000')
		{
			echo('<pre>' . htmlspecialchars($tune->comment) . '</pre>');
		}
		*/
		?>
	</li>
<?php $i++;} ?>
</ul>